package com.zhende.hr.mapper.oaview;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.zhende.hr.entity.User;

@Mapper
public interface OutAuthDao {

	
	@Select("select uuid,username as realName,password from oa_out_auth where username=#{name} and password=#{password} ")
	User getUsers(@Param("name")String name,@Param("password")String password);
	
	
	@Select("select uuid,username as realName,password from oa_out_auth where username=#{name}  ")
	User getUserByName(@Param("name")String name);
	
	
	@Select("select uuid,username as realName,password from oa_out_auth where uuid=#{uuid}  ")
	User getUserByUUID(@Param("uuid")String uuid);
	
	// 接口调用记录
	@Insert("INSERT INTO [dbo].[oa_out_log]([auth_id], [url], [ip], [type]) VALUES (#{name}, #{url},  #{ip},  #{type})")
	int saveOpeLog(@Param("name")String name,@Param("url")String url,@Param("ip")String ip,@Param("type")String type);
}
